﻿namespace GameBase.Sounds
{
    /// <summary>
    /// Defines an interface for basic management of playlist playback.
    /// </summary>
    public interface IPlayList
    {
        #region Properties

        /// <summary>
        /// Sets whether the playlist will be played back again.
        /// </summary>
        bool Repeat { set; }

        /// <summary>
        /// Gets whether playback of the playlist is already done.
        /// </summary>
        bool Finish { get; }

        #endregion

        #region Start, Stop

        /// <summary>
        /// Starts playback of a playlist at a specific index.
        /// </summary>
        /// <param name="playList">List of cue friendly names to be played.
        /// <para>If the list is null or empty, no action will be performed.</para></param>
        /// <param name="startIndex">Index of the first cue to start from.
        /// <para>If no valid index provided, an index value of '0' will be used.</para></param>
        void Start(string[] playList, int startIndex);

        /// <summary>
        /// Starts playback of a playlist from the beginning.
        /// </summary>
        /// <param name="playList">List of cue friendly names to be played.</param>
        void Start(string[] playList);

        /// <summary>
        /// Stops playback of a playlist.
        /// <para>The playlist must have been started previously.</para>
        /// </summary>
        void Stop();

        #endregion

        #region Play, Pause

        /// <summary>
        /// Resumes playback of a paused playlist.
        /// <para>The playlist must have been started previously.</para>
        /// </summary>
        void Play();

        /// <summary>
        /// Pauses playback of a playlist.
        /// <para>The playlist must have been started previously.</para>
        /// </summary>
        void Pause();

        #endregion

        #region Next, Previous

        /// <summary>
        /// Moves to the next song in the playlist.
        /// <para>The playlist must have been started previously.</para>
        /// </summary>
        void Next();

        /// <summary>
        /// Moves to the previous song in the playlist.
        /// <para>The playlist must have been started previously.</para>
        /// </summary>
        void Previous();

        #endregion

        #region Volume

        /// <summary>
        /// Sets the volume of all songs in the playlist.
        /// </summary>
        /// <param name="volume">Volume amount (0.0f -> silence - 1.0f -> full volume).</param>
        void SetVolume(float volume);

        #endregion
    }
}
